//
//  NWConstant.h
//  ylh-app-primary-ios
//
//  Created by YueWen on 2018/11/28.
//  Copyright © 2018 巨商汇. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <MBProgressHUD/MBProgressHUD.h>
#import <RITLKit/RITLKit.h>

NS_ASSUME_NONNULL_BEGIN

/// 用于跳转的配置key
static NSString *const QDGlobalPlatform = @"platform";


/// 用于区分原有接口资讯、生活圈等类型 - mid

///// 资讯
//static NSString *const QDListTypeKeyNews = @"20";
///// 生活圈
//static NSString *const QDListTypeKeyLife = @"3";
///// 地铁约
//static NSString *const QDListTypeKeyMetroDate = @"7";

//TODO: 账号

/// 极光
static NSString *const JPUSH_APP_KEY = @"1ade2d1de0aff1a5d47a51e6";
static NSString *const JPUSH_CHANNEL = @"dc5afbe01cb442485dde8fbf";
#define JPUSH_IS_PRODUCTION    YES

/// UM
static NSString *const UM_APP_KEY = @"5ab1cc088f4a9d3951000011";
static NSString *const UM_APP_CHANNEL = @"App Store";


/// 微信
static NSString *const WX_APP_KEY = @"wx456ba221a552b382";
static NSString *const WX_APP_SECRET = @"227d3eb0851649c5fa15e208cca0c5e0";

/// QQ
static NSString *const QQ_APP_KEY = @"1106857730";

/// 新浪
static NSString *const SINA_APP_KEY = @"3277365170";
static NSString *const SINA_APP_SECRET = @"841ca0663c86446237f10dd42bdcc581";

/// Apple Apy
static NSString *const APPLE_PAY_MERCHANT_ID = @"merchant.com.sdjictec.qdmetro";

/// Bugly
static NSString *const BUGLY_APP_ID = @"b82551f22e";
static NSString *const BUGLY_APP_KEY = @"4a4d5c8d-bcdf-42c8-a07e-206026d79fd1";


/// 活动盒子的app key
static NSString *const HZ_APP_KEY = @"833db87362b8669094f122527dc663a3";//正式的
//static NSString *const HZ_APP_KEY = @"da80c6aaa0f36ac11de3c1806aa9086a";

//TODO:
#define QDSColorTheme (RITLColorFromIntRBG(105, 201, 121))
#define QDSColorDefaultGray (RITLColorFromIntRBG(151, 153, 152))
#define QDSColorDefaultGray2 (RITLColorFromIntRBG(177, 179, 177))
#define QDSColorDefaultSeparator (RITLColorFromIntRBG(76, 77, 76))
#define QDSColorDefaultBlack (RITLColorFromIntRBG(88, 89, 89))

/// 首页底部的颜色
#define QDSMainPageBottomColor (RITLColorSimpleFromIntRBG(252))

/// 基础url
#define QDBaseRequestUrlAppendTo ([NSString stringWithFormat:@"%@%@",QDBaseUrl,x])

#define QDSafeString(x) (x ? x : @"")

/// 工具
@interface QDConstant : NSObject

+ (void)showMBHudwithText:(NSString *)text OnView:(UIView *)view DelayTime:(NSInteger)delayTime;

/// 验证身份证号
+ (BOOL) validateIdentityCard: (NSString *)identityCard;

@end


inline static CGFloat NWScale(CGFloat origin)
{
    CGFloat screenWidth = [UIScreen mainScreen].bounds.size.width;
    if (screenWidth >= 375) { return origin; }
    return (screenWidth * origin) / 375;
}


inline static CGFloat NWAllScale(CGFloat origin)
{
    CGFloat screenWidth = [UIScreen mainScreen].bounds.size.width;
    return (screenWidth * origin) / 375;
}


extern void ShowMBHudwithText(NSString *text,UIView *onView);
extern void ShowMBHUD(NSString *text,UIView *onView);
extern void ShowMBHudwithDelayTime(NSString *text,UIView *onView,NSInteger delayTime);
extern void DismissMBHUD(UIView *onView);
extern void ShowWaitingHUD(UIView *onView);
extern void ShowProgressHUD(UIView *onView,double progress);


/// 是否是小屏手机
static inline BOOL isSmallerScreen(){
    return UIScreen.mainScreen.bounds.size.width < 375;
}


/// MARK: 二维码界面


/// 为了适配X，二维码图片距离顶部额外增加的top
static inline NSInteger QDAddtionTopDistance(){

    if (RITL_HAVE_PHONE_HEADER) {
        return 8;
    }
    return 0;
}



/// 为了适配X，提示文字距离二维码图片底部额外增加的middle
static inline NSInteger QDAddtionMiddleDistance(){

    if (RITL_HAVE_PHONE_HEADER) {
        return 28;
    }
    return 0;
}


/// 为了适配X，error模式下的图标距离顶部的距离额外增加
static inline NSInteger QDErrorAddtionTopDistance(){
    
    if (RITL_HAVE_PHONE_HEADER) {
        return 16;
    }
    return 0;
}


/// 为了适配X，error模式下的按钮距离底部的距离额外增加
static inline NSInteger QDErrorAddtionBottomDistance(){
    
    if (RITL_HAVE_PHONE_HEADER) {
        return 16;
    }
    return 0;
}


NS_ASSUME_NONNULL_END
